package cate.game.role.bag.item.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBBag;
import cate.game.role.Role;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "背包扩容 の 请求")
@OperationSetter(value = GDOperation.CAPACITY_ADD_REQ, sub="type")
public class BagCapacityAddReq implements MsgInput {
    @NoteField(value = "背包类型", detail = "道具背包的type为3")
    public byte type;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        Role role = cc.getRole();
        role.getBag().addCapacity(type);
        cc.sendNow(new BagCapacityResp(role));
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBBag.CAPACITY_ADD_REQ;
    }
}
